package com.lagou.common.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import javax.persistence.Id;
import javax.persistence.Table;

@Data
@Table(name = "products")
@Document(indexName = "lagou",type = "product",shards = 3,replicas = 1)
public class Products {

    @Id
    @TableId(type = IdType.AUTO)
    private Integer id;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String name;
    @Field(type = FieldType.Double)
    private Double price;
    @Field(type = FieldType.Keyword)
    private String flag;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String goodsDesc;
    @Field(type = FieldType.Keyword,index = false)
    private String images;
    @Field(type = FieldType.Long)
    private Long goodsStock;
    @Field(type = FieldType.Keyword)
    private String goodsType;

}
